class Queue {
  constructor(content = []) {
    this._queue = [...content]
  }
  pop() {
    const value = this._queue[0]
    this._queue.splice(0, 1)
    return value
  }
  length() {
    return this._queue.length
  }
  get(index = 0) {
    return this._queue[index]
  }
  push(item) {
    this._queue.push(item)
  }
}
new Queue([1, 2, 3])

class PeekQueue extends Queue {
  peek() {
    return this._queue[0]
  }
}
